package api

import (
	"github.com/gin-gonic/gin"
	"live/api/hendler"
	"live/api/middleware"
	"live/pkg/jwt"
)

func Route(r *gin.Engine) {
	r.Use(middleware.Test())
	api := r.Group("api")
	{
		api.POST("/register", hendler.Register)
		api.POST("/login", hendler.Login)
		api.Use(jwt.JWTAuth("2210A"))
		api.POST("/addRoom", hendler.AddRoom)
		api.POST("/listRoom", hendler.ListRoom)
		api.POST("/updateRoom", hendler.UpdateRoom)
		api.POST("/deleteRoom", hendler.DeleteRoom)
		api.POST("/addComment", hendler.AddComment)
		api.POST("/listComment", hendler.ListComment)
		api.POST("/updateComment", hendler.UpdateComment)
		api.POST("/deleteComment", hendler.DeleteComment)
		api.POST("/addGift", hendler.AddGift)
		api.POST("/listGift", hendler.ListGift)
		api.POST("/updateGift", hendler.UpdateGift)
		api.POST("/deleteGift", hendler.DeleteGift)
	}
}
